package com.ce.yw.leaveflow.activiti;

import java.util.List;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

import com.ce.pub.process.logic.ProcessDealService;
import com.ce.sys.login.model.User;
import com.ce.sys.person.dao.po.SysPerson;





public class DeptManagerListener implements TaskListener {

	private ProcessDealService processDealService;
	@Override
	public void notify(DelegateTask task) {
		List<SysPerson>  managers=processDealService.getPersonsByDepAndRole(User.getUserOrgId(), "部门主管");
		for(SysPerson manager:managers){
			task.addCandidateUser(manager.getVcId());
		}
	
	}
	public void setProcessDealService(ProcessDealService processDealService) {
		this.processDealService = processDealService;
	}

	
	

}
